package com.sch.study.pattern.SingletonTest;

/**
 * User: hui_stone
 * Date: 2016/3/1 0001
 * Time: 下午 21:15
 */
public class StaticSingleton {

    private StaticSingleton(){
        System.out.println(" singleton is creating");
    }

    private static class SingletonHolder{
        private static StaticSingleton instance = new StaticSingleton();
    }

    public static StaticSingleton getInstance(){
        return SingletonHolder.instance;
    }

    public static void main(String[] args) {
        System.out.println("===="+StaticSingleton.getInstance());
        System.out.println("===="+StaticSingleton.getInstance());
        System.out.println("===="+StaticSingleton.getInstance());
    }
}
